Skip to content

mapgen build mesh priority update#1252

Merged
Oathseeker merged 1 commit intoOpenKH:masterfrom
Kite2810:master
Feb 25, 2026
Merged

mapgen build mesh priority update#1252
Oathseeker merged 1 commit intoOpenKH:masterfrom
Kite2810:master

Conversation

@Kite2810
Copy link
Contributor

@Kite2810 Kite2810 commented Feb 23, 2026

Updates a small part of Mapgen in order to specify in which Priority you wanna built your meshes. Useful for meshes that uses Transparent Textures, that are drawn over other meshes that use transparency.

Exxample - in mapdef.yml use:

  • name: 'Skybox01' transparentFlag: 1 noShadow: true uvscIndex: 1 priority: 1
  • name: 'Skybox02' noShadow: true priority: 2
  • name: 'Skybox03' transparentFlag: 1 noShadow: true priority: 3

basically two small changes. The sort is stable for unprioritized faces (they still preserve their original relative order via "ThenBy(originalIndex)"), and priority 1 will genuinely be the very first mesh built/rendered, priority 2 second, etc.

Hope that's somewhat clear :D

Summary by CodeRabbit

  • New Features
    • Material priority support has been added to enhance map generation workflows. Materials can now be assigned numeric priority values to control their processing sequence. Prioritized materials are processed first, sorted by their priority value in ascending order, followed by unprioritized materials in their original order.

Updates a small part of Mapgen in order to specify in which Priority you wanna built your meshes. Useful for meshes that uses Transparent Textures, that are drawn over other meshes that use transparency.

Exxample - in mapdef.yml use:
  - name: 'Skybox01'
    transparentFlag: 1
    noShadow: true
    uvscIndex: 1
    priority: 1
  - name: 'Skybox02'
    noShadow: true
    priority: 2
  - name: 'Skybox03'
    transparentFlag: 1
    noShadow: true
    priority: 3

materials with priority 1 will get build first into the kh2.map file.
@coderabbitai
Copy link

coderabbitai bot commented Feb 23, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info

Configuration used: defaults

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 80e52ec and eeafaf4.

📒 Files selected for processing (2)
  • OpenKh.Command.MapGen/Models/MaterialDef.cs
  • OpenKh.Command.MapGen/Utils/MapBuilder.cs

📝 Walkthrough

Walkthrough

Two files are modified to introduce a material priority system in map generation. A new nullable priority property is added to MaterialDef with documentation, and MapBuilder implements face reordering logic to process prioritized materials first, followed by unprioritized materials in original order.

Changes

Cohort / File(s) Summary
Material Property Definition
OpenKh.Command.MapGen/Models/MaterialDef.cs
Added nullable integer priority property with XML documentation explaining that lower values are built first and unprioritized items are appended after prioritized ones.
Priority-Based Face Reordering
OpenKh.Command.MapGen/Utils/MapBuilder.cs
Added pre-processing logic to reorder faces by prioritizing materials with priority values, sorting by priority and original index for stable ordering.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

🐰 Materials march in ordered line,
With priority values so fine,
Lower numbers lead the way,
While the rest in queue will stay—
Building maps in grand design! ✨

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'mapgen build mesh priority update' directly and clearly describes the main change: adding a priority mechanism to the mapgen mesh building system.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
  • 📝 Generate docstrings (stacked PR)
  • 📝 Generate docstrings (commit on current branch)
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

Tip

Issue Planner is now in beta. Read the docs and try it out! Share your feedback on Discord.


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

@Oathseeker Oathseeker merged commit 83735f3 into OpenKH:master Feb 25, 2026
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants